<template>
	<view>
		<view class="dis_f aic juc mt20">
			<image :src="imgurl" mode="aspectFill" class="haibimg" @click="clickImg"></image>
		</view> <button class="dis_f aic juc w100 fs28 mt20" @click="clickImg">
			保存转发好友
		</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgurl: ""
			}
		},
		onLoad() {
			uni.showLoading({
				title: '海报加载中...'
			});

			this.postlist()
		},
		methods: {
			postlist() {
				let that = this
				that.api.post('user/setPsImg').then(res => {
					console.log(res);
					if (res.code == 200) {
						this.imgurl = res.data.imgurl
						uni.hideLoading();
					}


				})
			},
			clickImg() {
				wx.downloadFile({
					url: this.imgurl,
					success: (res) => {
						wx.showShareImageMenu({
							path: res.tempFilePath
						})
					}
				})
			},
		}
	}
</script>

<style>
	.haibimg {
		width: 100%;
		height: 72vh;
		width: 85%;
		height: 61vh;
		border: 1px solid #efefef;
		border-radius: 12rpx;
	}
</style>